home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / STANDALO / SPROING! / SPROING_.C2 < prev   
Text File  |  1990-10-27  |  1KB  |  42 lines

  1. /*_________________________________________________________________________
  2.  
  3.         Sproing - A Springy Cursor INIT 
  4.         
  5.         October 1990
  6.         
  7.         ⌐1990 Scott Armitage
  8.     
  9.         Written for Think C
  10.     
  11.     This INIT installs the VBL task created in the Sproing VBL project.
  12.  
  13.     The Sproing VBL should be compiled and merged with the
  14.     "Sproing INIT.rsrc" file prior to creating the INIT.
  15.     
  16. _________________________________________________________________________*/
  17.  
  18. #include "VRetraceMgr.h"
  19.  
  20. /*_____________________________________________________________________*/
  21. main()
  22. {
  23.     Handle ourCode;
  24.     VBLQElPtr vblPtr;
  25.     
  26.     ourCode = GetResource('vbl ', 999);                    /* load our VBL code */
  27.     if (ourCode != 0) {
  28.         HLock(ourCode);
  29.         DetachResource(ourCode);                        /* make it permanent */
  30.         
  31.         vblPtr = (VBLQElPtr) NewPtrSys(sizeof(VBLTask)); /* allocate vbl queue entry */
  32.         if (vblPtr != 0) {
  33.             vblPtr->qType = vType;                        /* fill in vbl queue entry */
  34.             vblPtr->vblAddr = (ProcPtr) *ourCode;
  35.             vblPtr->vblCount = 1;
  36.             vblPtr->vblPhase = 0;
  37.         
  38.             VInstall(vblPtr);                            /* install it */
  39.         }
  40.     }
  41. }
  42.